package com.zaofan.mobile.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zaofan.cache.CacheManage;
import com.zaofan.utils.JsonUtils;

@WebServlet("/mobile/city")
public class CityController extends BaseServlet {

	private static final long serialVersionUID = 5884947841079014459L;

	/**
	 * 开通城市接口
	 * 
	 * @param request
	 * @param response
	 * @throws ServletException
	 * @throws IOException
	 */
	protected void list(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		try {
			JsonUtils.writeSuccessJson("查询成功", CacheManage.openCities, response);
			return;
		} catch (Exception e) {
			e.printStackTrace();
			JsonUtils.writeListFailJson("查询失败", response);
		}
		JsonUtils.writeListFailJson("查询失败!!" + ",未知错误", response);
	}

}
